//
//  NSArray+Extension.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/8/6.
//

import UIKit


extension Array {
    func toJson() -> String {
        if (!JSONSerialization.isValidJSONObject(self)) {
            print("无法解析出JSONString")
            return ""
        }
            
        let data : NSData! = try? JSONSerialization.data(withJSONObject: self, options: []) as NSData?
        let JSONString = NSString(data:data as Data,encoding: String.Encoding.utf8.rawValue)
        return JSONString! as String
    }
}
